let options = document.querySelectorAll(".option");
let con = document.querySelector(".container");
let feedback = document.querySelector(".feedback");
let i = 0;
let resList = ["happy", "neutral", "unhappy"];
let res = document.querySelector(".res");
let btn = document.querySelector("button");
options.forEach((option, idx) => {
  option.addEventListener("click", () => {
    removeAll();
    option.classList.add("on");
    i = idx;
  });
});

btn.addEventListener("click", () => {
  con.style.display = "none";
  feedback.style.display = "block";
  res.textContent = resList[i];
});

function removeAll() {
  options.forEach((option) => {
    option.classList.remove("on");
  });
}
